package com.tender.constants;

public interface Constants {

    String SESSION_ID_FROM_JTI = "jti";

    String UTF_8_ENCODING = "utf-8";
    String CONTENT_TYPE_WITH_UTF_8_AND_JSON = "application/json; charset=utf-8";

    /** jwt 相关 start */
    String AUTHORIZATION_HEADER= "jwtToken";

    // 未登录
    String NO_LOGIN_CODE = "10000";
    String NO_LOGIN_MESSAGE = "请先进行登录";

    // 登录成功
    String LOGIN_SUCCESS_CODE = "10010";
    String LOGIN_SUCCESS_MESSAGE = "登录成功";

    // 登录失败
    String LOGIN_FAILURE_CODE = "10020";
    String LOGIN_FAILURE_MESSAGE = "登录失败";

    // 登录账号不存在
    String LOGIN_NAME_NOT_EXIST = "10030";
    String  LOGIN_NAME_NOT_EXIST_MESSAGE = "登录账号不存在";

    // 登录密码不匹配
    String PASSWORD_INCORRECT_CODE = "10040";
    String PASSWORD_INCORRECT_MESSAGE = "登录密码不匹配";

    // 密码尝试次数超限
    String PASSWORD_ATTEMPTS_EXCEEDED_CODE = "10050";
    String PASSWORD_ATTEMPTS_EXCEEDED_MESSAGE = "密码尝试次数超限";

    // 没有角色权限
    String NO_ROLE_AUTHORITY_CODE = "10060";
    String NO_ROLE_AUTHORITY_MESSAGE = "没有角色权限";

    // 没有资源操作权限
    String NO_RESOURCE_AUTHORITY_CODE = "10070";
    String NO_RESOURCE_AUTHORITY_MESSAGE = "没有资源操作权限";

    /** jwt 相关 end */

    /**
     * 同一个账号，在线同时登录人数限制
     */
    int CURRENT_LOGIN_NUM_4_LOGIN_NAME = 1;

    /**
     * 密码尝试次数超过一定次数后，就限制 多少分钟内 禁止登录
     */
    int BLOCK_LOGIN_TIME = 2;

    long PASSWORD_TRY_LIMIT = 4L;
    int REDIS_DEFAULT_PORT = 6379;

    long GLOBAL_SESSION_TIMEOUT = 360000L;

    String COOKIE_NAME = "SHIRO_COOKIE";

    long FIVE_MINUTES_2_SECONDS = 5 *60;

    String CONNECT_STR = ":";

    String SHIRO = "shiro";

    String USER = "user";

    String ROLE = "role";

    String RESOURCE = "resource";

    /**
     * 结果成功是否
     */
    String OK = "OK";

    String FAIL = "FAIL";

    /**
     * hash算法
     */
    String HASH_ALGORITHM = "SHA-1";

    /**
     * 计算次数
     */
    int HASH_ITERATIONS = 1024;

    /**
     * 默认分页数
     */
    Integer DEFAULT_PAGE_INDEX = 0;
    /**
     * 默认分页大小
     */
    Integer DEFAULT_PAGE_SIZE = 10;

    Long ONE = 1L;
}
